package com.wxlsoft.excel.extract;

import java.util.List;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.util.StringUtils;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 接口清单列表
 * @author wangxiaoliang
 */
@Getter
@Setter
@ToString
public class InterfaceManifest {

	@ExcelProperty(index = 1)
    private String name;
	
	@Getter
	@Setter
	@ToString
	public static class SheetInput {
		
		@ExcelProperty(index = 2)
	    private String field;
		
		@ExcelProperty(index = 4)
	    private String fieldName;
		
		public boolean isNotEmpty() {
			return StringUtils.isNotBlank(field) 
					|| StringUtils.isNotBlank(fieldName);
		}
		
	}
	
	@Getter
	@Setter
	@ToString
	@AllArgsConstructor
	public static class SheetOutput {
		
		@ExcelProperty(value = "字段名称")
	    private String field;
		
		@ExcelProperty(value = "字段中文名")
	    private String fieldName;
		
	}	
	
	/**
	 * 输出数据
	 * @author wangxiaoliang
	 */
	@Getter
	@Setter
	@ToString
	@AllArgsConstructor
	public static class SheetData {
		
	    private String name;
		
	    private List<SheetOutput> rows;
		
	}	
	
}
